package main

import (
	"bufio"
	"fmt"
	"strings"
)

func main() {
	// 创建Reader对象并传入要分割的字符串
	reader1 := bufio.NewReader(strings.NewReader("abcdefg 1000phone blockchain go"))
	// 创建scanner对象
	scanner := bufio.NewScanner(reader1)
	// 指定分割方法，按按照空格进行拆分
	scanner.Split(bufio.ScanWords)
	// 循环读取
	for scanner.Scan() {
		fmt.Println(scanner.Text())
		if scanner.Text() == "q!" {
			break
		}
	}
}
